<?php include $this->admin_tpl('meta');?>
<title>TAG管理 - YzmCMS内容管理系统</title>
</head>
<body>
<nav class="breadcrumb"><i class="yzm-iconfont yzm-iconai-home"></i> 首页 <span class="c-gray en">&gt;</span> 内容管理 <span class="c-gray en">&gt;</span> TAG管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="yzm-iconfont yzm-iconshuaxin"></i></a></nav>
<div class="page-container">
  <div> 
		<form action="<?php echo U('init');?>" method="get">
		 <input type="hidden" value="<?php echo ROUTE_M;?>" name="m">
		 <input type="hidden" value="<?php echo ROUTE_C;?>" name="c">
		 <input type="hidden" value="init" name="a">	 
		 
		 添加时间：<input type="text" class="input-text laydate-icon" style="width:175px;height:30px;" id="start" name="start" <?php if(isset($_GET['start']) && $_GET['start'] != '') echo 'value="'.$_GET['start'].'"'; ?>>
		 至 <input type="text" class="input-text laydate-icon" style="width:175px;height:30px;" id="end" name="end" value="<?php if(isset($_GET['end']) &&  $_GET['end'] != '') echo $_GET['end']; else echo date('Y-m-d H:i:s'); ?>">
		<span class="select-box inline"><?php echo select_category('catid', $catid, '绑定栏目'); ?></span>
		<span class="select-box inline">
			<select name="type" class="select">
				<option <?php if(isset($_GET["type"]) && $_GET["type"]=='1'){echo "selected";} ?> value="1">TAG名称</option>
				<option <?php if(isset($_GET["type"]) && $_GET["type"]=='2'){echo "selected";} ?> value="2">TAGID</option>		
				<option <?php if(isset($_GET["type"]) && $_GET["type"]=='3'){echo "selected";} ?> value="3">SEO标题</option>		
				<option <?php if(isset($_GET["type"]) && $_GET["type"]=='4'){echo "selected";} ?> value="4">SEO关键字</option>		
				<option <?php if(isset($_GET["type"]) && $_GET["type"]=='5'){echo "selected";} ?> value="5">SEO描述</option>		
			</select>
		</span>
		<input type="text" name="searinfo"  class="input-text" style="width:200px" value="<?php if(isset($_GET['searinfo'])) echo $_GET['searinfo'];?>"><button name="dosubmit" class="btn btn-success btn-search" type="submit" value="1"><i class="yzm-iconfont yzm-iconsousuo"></i> 搜索</button>
		<a href="<?php echo U('init');?>" class="btn btn-primary radius"><i class="yzm-iconfont yzm-iconshuaxin"></i> 重置</a>
		</form>	
  </div>
	<div class="cl mt-15 tb-top"> <span class="l"> <a href="javascript:;" onclick="yzm_open('添加TAG','<?php echo U('add');?>',600,350)" class="btn btn-primary radius"><i class="yzm-iconfont yzm-icontianjia"></i> 添加TAG</a> <a href="javascript:;" onclick="yzm_dels('id', 1)" class="btn btn-danger radius"><i class="yzm-iconfont yzm-iconshanchu2"></i> 批量删除</a></span></div>
	<form method="post" action="<?php echo U('del');?>" id="myform">
	<table class="table table-border table-bg table-hover yzm-table-sort">
		<thead>
			<tr class="text-c">
				<th width="25"><input type="checkbox"></th>
				<th>ID<?php echo field_order('id');?></th>
				<th>TAG名称</th>
				<th>文档数<?php echo field_order('total');?></th>
				<th>点击量<?php echo field_order('click');?></th>
				<th>绑定栏目<?php echo field_order('catid');?></th>
				<th>SEO标题</th>
				<!-- <th>SEO描述</th> -->
				<th>添加时间<?php echo field_order('inputtime');?></th>		
				<th>管理操作</th>
			</tr>
		</thead>
		<tbody>
			<?php 
			   foreach($data as $val){
			 ?>
			<tr class="text-c">
				<td><input type="checkbox" value="<?php echo $val['id']?>" name="id[]"></td>
				<td><?php echo $val['id'];?></td>
				<td><a href="<?php echo $site_url.tag_url($val['id'], false);?>" target="_blank"><?php echo $val['tag'];?></a></td>
				<td><a href="<?php echo $site_url.tag_url($val['id'], false);?>" target="_blank"><?php echo $val['total'];?></a></td>
				<td><?php echo $val['click'];?></td>
				<td><?php echo $val['catid'] ? get_catname($val['catid']) : '无';?></td>
				<td><?php echo $val['seo_title'] ? $val['seo_title'] : '无';?></td>
				<!-- <td><?php echo $val['seo_description'] ? str_cut($val['seo_description'], 90) : '无';?></td> -->
				<td><?php echo date('Y-m-d H:i:s',$val['inputtime']);?></td>
				<td class="td-manage">
					<a title="编辑TAG" href="javascript:;" onclick="yzm_open('编辑TAG','<?php echo U('edit',array('id'=>$val['id']));?>',600,420)" class="btn-mini btn-primary">编辑TAG</a> 
					<a title="关联内容" href="javascript:;" onclick="yzm_open('标签【<?php echo $val['tag'];?>】关联内容','<?php echo U('content',array('id'=>$val['id']));?>')" class="btn-mini btn-success ml-5" style="text-decoration:none">关联内容</a> 
				</td>
			</tr>
			<?php 
			   }		 
			?>	
		</tbody>
	</table>
	<?php if(!$data){ ?><div class="yzm_no_data"><i class="yzm-iconfont yzm-iconshuoming"></i> 暂无数据</div><?php } ?>
	</form>
	<div id="page"><span class="page_left">共<?php echo $total?>条记录，共<?php echo $page->total()?>页，当前显示第<?php echo $page->getpage()?>页</span>
  <span class="page_right"><?php echo $page->getfull();?></span></div>
</div>
<?php include $this->admin_tpl('footer');?>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/laydate/1.1/laydate.js"></script>
<script type="text/javascript">
	var start = {elem:'#start',format:'YYYY-MM-DD hh:mm:ss',min:'1999-01-01',max:'2099-01-01',istime:true,istoday:false,choose:function(datas){end.min = datas;end.start = datas}
	};
	var end = {elem:'#end',format:'YYYY-MM-DD hh:mm:ss',min:'1999-01-01',max:'2099-01-01',istime:true,istoday:false,choose:function(datas){start.max = datas;}};
	laydate(start);
	laydate(end);
</script>
</body>
</html>